﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using StudentWeb.BLL;
using StudentWeb.Common;
using Newtonsoft.Json.Linq;

namespace StudentWeb.Api.Controllers
{
    public class BookController : ApiController
    {
        BookBO _bookBO=new BookBO();
        [HttpGet]
        public IHttpActionResult GetBookInfo(int bookID)
        {
            try 
            {
                var result = _bookBO.GetBookInfo(bookID);
                return Json(result);
            }
            catch (Exception ex)
            {
                return Json(new Result(ResultCode.Fail, ex.Message));
            }
        }
    }
}
